package com.old.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.old.dto.PostQueryDTO;
import com.old.entity.Post;
import com.old.result.PageBean;
import com.old.result.PageResult;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface PostService {

    Post createPost(Post post);
    Post getPostDetail(Integer id) throws JsonProcessingException;

    List<Post> findByAccountId(Integer accountId);
    //获取发帖列表-id
    PageBean getPostListById(PostQueryDTO postQueryDTO);

    @Transactional
    void deletePost( Integer postId,Integer userId);

    PageBean pageList(Integer pageNo, Integer pageSize, Integer sortBy, String searchTerms,Integer userId) throws JsonProcessingException;

    Integer likePost(Integer postId, Integer userId);

    //取消点赞
    @Transactional
    Integer cancelLike(Integer postId, Integer userId);

    //判断查看者是否点赞
    boolean isGood(Integer userId, Integer id);

    void deletePostsByIds(List<Integer> ids);
}
